//package MySQL;
//
//public class mysql1 {
//}
//
//create table test1 (
//        id bigint,
//        name varchar(20),
//sn varchar(10)
//);
//
//desc table test1;
//show index from test1;
//
//alter table test1 add primary key (id);
//alter table test1 modify id bigint auto_increment;
//alter table test1 modify id bigint;
//
//desc test1;
//
//drop table test1;
//
//create table test2 (
//        id bigint primary key auto_increment,
//        name varchar(20) unique,
//sn varchar(20),
//index (sn)
//);
//
//
//desc test2;
//
//desc table test2;
//
//alter table test2 drop index sn;
//
//create index index_test2_sn on test2 (sn);
//
//show keys from test2;
//
//create table test3 (
//        id bigint primary key auto_increment,
//        name varchar(20),
//sn varchar(20),
//class_id bigint,
//index (sn, name)
//);
//
//desc test3;
//show keys from test3;
//
//alter table test3 drop index (sn, name);
//
//create table test4 (
//        id bigint primary key auto_increment,
//        name varchar(20),
//sn varchar(20),
//class_id bigint
//);
//
//create index index_test4_sn_name on test4 (sn, name);
//
//desc test4;
//show keys from test4;
//
//alter table test4 drop index index_test4_sn_name;
//create index index_test4_sn on test4 (sn);
//create index index_test4_name on test4 (name);
//
//alter table test4 drop primary key;
//alter table test4 modify id bigint;
//
//desc test4;
//
//show keys from test4;
//
//alter table test4 drop index index_test4_sn;
//alter table test4 drop index index_test4_name;
//
//drop table test4;
//
//select * from student;
//
//desc student;
//
//explain select * from student;
//
//explain select * from student where class_id = 1;
//
//explain select * from student where class_id in (select class_id from student where class_id = 1);
//
//
//select * from student where class_id in (select class_id from student where class_id = 1);
//
//explain select * from student where student_id in (select student_id from student where student_id = 1);
//
//Enter password: *********
//Welcome to the MySQL monitor.  Commands end with ; or \g.
//Your MySQL connection id is 8
//Server version: 8.0.39 MySQL Community Server - GPL
//
//Copyright (c) 2000, 2024, Oracle and/or its affiliates.
//
//Oracle is a registered trademark of Oracle Corporation and/or its
//affiliates. Other names may be trademarks of their respective
//owners.
//
//        Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
//
//mysql> use java113;
//Database changed
//mysql> show index from test;
//+-------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+---------+------------+
//        | Table | Non_unique | Key_name | Seq_in_index | Column_name | Collation | Cardinality | Sub_part | Packed | Null | Index_type | Comment | Index_comment | Visible | Expression |
//        +-------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+---------+------------+
//        | test  |          0 | PRIMARY  |            1 | id          | A         |           0 |     NULL |   NULL |      | BTREE      |         |               | YES     | NULL       |
//        +-------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+---------+------------+
//        1 row in set (0.00 sec)
//
//mysql> show keys from test2;
//+-------+------------+----------------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+---------+------------+
//        | Table | Non_unique | Key_name       | Seq_in_index | Column_name | Collation | Cardinality | Sub_part | Packed | Null | Index_type | Comment | Index_comment | Visible | Expression |
//        +-------+------------+----------------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+---------+------------+
//        | test2 |          0 | PRIMARY        |            1 | id          | A         |           0 |     NULL |   NULL |      | BTREE      |         |               | YES     | NULL       |
//        | test2 |          0 | name           |            1 | name        | A         |           0 |     NULL |   NULL | YES  | BTREE      |         |               | YES     | NULL       |
//        | test2 |          1 | index_test2_sn |            1 | sn          | A         |           0 |     NULL |   NULL | YES  | BTREE      |         |               | YES     | NULL       |
//        +-------+------------+----------------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+---------+------------+
//        3 rows in set (0.00 sec)
//
//mysql> desc test2;
//+-------+-------------+------+-----+---------+----------------+
//        | Field | Type        | Null | Key | Default | Extra          |
//        +-------+-------------+------+-----+---------+----------------+
//        | id    | bigint      | NO   | PRI | NULL    | auto_increment |
//        | name  | varchar(20) | YES  | UNI | NULL    |                |
//        | sn    | varchar(20) | YES  | MUL | NULL    |                |
//        +-------+-------------+------+-----+---------+----------------+
//        3 rows in set (0.00 sec)
//
//mysql> desc test4;
//+----------+-------------+------+-----+---------+----------------+
//        | Field    | Type        | Null | Key | Default | Extra          |
//        +----------+-------------+------+-----+---------+----------------+
//        | id       | bigint      | NO   | PRI | NULL    | auto_increment |
//        | name     | varchar(20) | YES  |     | NULL    |                |
//        | sn       | varchar(20) | YES  | MUL | NULL    |                |
//        | class_id | bigint      | YES  |     | NULL    |                |
//        +----------+-------------+------+-----+---------+----------------+
//        4 rows in set (0.00 sec)
//
//mysql> ^A
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
